#!/usr/bin/env bash

set -e

echo "===> Bundling..."
script/bootstrap --quiet

for testvar in LOGIN PASSWORD TOKEN CLIENT_ID CLIENT_SECRET
do
  octokitvar="OCTOKIT_TEST_GITHUB_${testvar}"
  if [[ -z "${!octokitvar}" ]]; then
      echo "Please export ${octokitvar}";
  fi
done

echo "===> Running specs..."
(unset OCTOKIT_LOGIN; unset OCTOKIT_ACCESS_TOKEN; bundle exec rake spec)
